package com.briup.web.controller;

import com.briup.resuit.Result;
import com.briup.utils.UploadUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;

import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@Api("文件上传模块")
@Slf4j
@RestController
public class UploadController {
    @Autowired
     UploadUtils uploadUtils;
    @PostMapping("/auth/upload")
    public Result upload(@RequestPart MultipartFile img) throws Exception {
        return Result.success(uploadUtils.fileToOSS(img));
    }
}
